package Practice03_exam;

public class Rectangle {
    private int cx;
    private int cy;
    private int bx;
    private int by;
    public Rectangle(int cx, int cy, int bx, int by){
        this.cx = cx;
        this.cy = cy;
        this.bx = bx;
        this.by = by;
    }
//    public Rectangle(Point pointC, Point pointB){
//        cx = pointC.getX();
//        cy = pointC.getY();
//        bx = pointB.getX();
//        by = pointB.getY();
//    }

    public int calculateC(){
        return 2*(Math.abs(bx-cx)+Math.abs(cy-by));
    }

    public int calculateS(){
        return Math.abs(bx-cx)*Math.abs(cy-by);
    }

}
